import { _decorator, Component, EventTouch, Node, systemEvent, SystemEvent ,Input, input} from 'cc';
const { ccclass, property } = _decorator;

@ccclass('airOpera')
export class airOpera extends Component {

    @property
    public speed =1

    @property
    public speedZ =0.1

    start() {
        input.on(Input.EventType.TOUCH_MOVE, this._onTouchMove, this)
    }

    // update(deltaTime: number) {
        
    // }

    _onTouchMove(event: EventTouch) {
        const delta = event.getDelta()
        let pos = this.node.position
        this.node.setPosition(pos.x + 0.01 * this.speed * delta.x, pos.y, pos.z - this.speedZ * delta.y)
    }
    
}


